<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    /*
     开发中经常需要复制一个对象如果直接用赋值会有如下问题： 
     */
    const object1 = { name: "陶品奇", age: 22 }
    //实际是将object1在栈内存中的地址赋值给了object2 ,console.log(object1===object2)true
    const object2 = object1
    // 通过object2修改name属性，object1也随着被修改了
    object2.name = "马云"
    console.log(object1, object2);
  </script>
</body>

</html>